<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
	<head>
	<%@ include file="/include/header.jsp" %>
	</head>
<body>
      <div class="clearfix p_t20">
		<form action="${ctx}/${simpleBeanName}/add.do" method="post" id="addform">
			<div class="clearfix p_t20">
					<table class="u_table">
						<#list columnList as column>				
						<tr>
							<td class="t_r">${column.dbColumnComment}：</td>
							<td><input type="text" class="all_txt" id="${column.javaPropertyName}" name="${column.javaPropertyName}" /></td>
						</tr>					
						</#list>					
					</table>
			</div>
		</form>
		
		<div class="action_b">
			<button class="b_btn m_r20" id="enterbtn">确定</button>
			<button class="b_btn" id="backbtn">返回</button>
		</div>     	
      </div>
	<script type="text/javascript">

		$(function() {
			//添加
			$("#enterbtn").click(function() {
				var loading=parent.window.document.getElementById("loading");
				loading.style.display="block";
				$("#addform").ajaxSubmit(function(result){
					loading.style.display="none";
					if(result.status==1){
						parent.search();
						alert("添加成功");
						back();
					}else{
						alert(result.mess);
					}
				},"json");					
			});
			
			//返回
			$("#backbtn").click(function() {
				back();
			});			
			
		});
		
		function back(){
			parent.dialog.close();
		}
	</script>      
</body>
</html>